package com.zhang.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 购物车实体类
 */
@Data
@NoArgsConstructor
public class ShopBean {
    /**购物车id*/
    private int shopId;
    /**购买商品*/
    private ProductBean productBean;
    /**购买该商品的数量*/
    private int num = 1;
    /**所属用户*/
    private UserBean userBean;


    public ShopBean(int productId, int userId) {
        this.productBean = new ProductBean();
        productBean.setProductId(productId);
        this.userBean = new UserBean();
        userBean.setUserId(userId);
    }

    @Override
    public String toString() {
        return "ShopCarBean{" +
                "shopId=" + shopId +
                ", productBean=" + productBean +
                ", num=" + num +
                ", userBean=" + userBean +
                '}';
    }
}
